From: Wei Liu Date: Thu, 23 Jul 2015 07:59:05 +0000 (+0100) Subject: xl: free pid string in do_daemonize X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2693 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6aef0ff045fe46bac58d3fca8b10fa688fad6e47;p=xen.git xl: free pid string in do_daemonize Pid is a null terminated string allocated by asprintf. It should be freed after use. Also fixed a coding style problem while I was there. Signed-off-by: Wei Liu Acked-by: Ian Campbell --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index a578e3b6e2..9027acba81 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -524,10 +524,12 @@ static int do_daemonize(char *name, const char *pidfile) exit(1); } - if ( close(fd) < 0 ) { + if (close(fd) < 0) { perror("Closing pidfile"); exit(1); } + + free(pid); } out: